home *** CD-ROM | disk | FTP | other *** search
- ;%%%%%%%%%%%%%%%%%%%%%%%%
- ;script Idle Scanner
- ;version 7.0
- ;author Quietust
- ;email quietust@ircN.org
- ;url http://www.ircN.org
- ;%%%%%%%%%%%%%%%%%%%%%%%%
- on 1:CONNECT {
- .remove $tp(idle.txt)
- .remove $tp(idlep.txt)
- if (%idauto == on) { .timer 0 300 idchk | set %idchktimer $ltimer }
- }
- on 1:INPUT:# {
- if ($left($1,1) != /) return
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $active $me $ctime
- }
- on 1:JOIN:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:PART:# {
- if ($isvalidchan(%idchan,$chan)) remini $tp(idle.txt) $chan $nick
- }
- on 1:QUIT {
- set %i 0
- :start
- inc %i
- if ($comchan($nick,%i)) {
- if ($isvalidchan(%idchan,$comchan($nick,%i))) remini $tp(idle.txt) $comchan($nick,%i) $nick
- goto start
- }
- }
- on 1:TEXT:*:# {
- if ($isvalidchan(%idchan,$chan)) {
- if (($1- == %idphrase) && (%idtog == on) && ($nick !isop $chan)) .quote kick $chan $nick : $+ %idreason
- else writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- }
- on 1:NICK {
- set %i 0
- :start
- inc %i
- if ($comchan($newnick,%i)) {
- if ($isvalidchan(%idchan,$comchan($newnick,%i))) {
- remini $tp(idle.txt) $comchan($newnick,%i) $nick
- writeini -n $tp(idle.txt) $comchan($newnick,%i) $newnick $ctime
- }
- goto start
- }
- }
- on 1:ACTION:*:# {
- if ($isvalidchan(%idchan,$chan)) {
- if (($1- == %idphrase) && (%idtog == on) && ($nick !isop $chan)) .quote kick $chan $nick : $+ %idreason
- else writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- }
- on 1:KICK:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:OP:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:DEOP:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:VOICE:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:DEVOICE:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:HELP:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:DEHELP:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:BAN:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:UNBAN:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:TOPIC:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- on 1:MODE:# {
- if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
- }
- raw 324:* {
- if ($isvalidchan(%idchan,$2)) idle -r $2
- }
- alias n.idle return $readini $tp(idle.txt) $1 $2
- alias ch.idle {
- if ($n.idle($1,$2)) return $n.idle($1,$2)
- else {
- writeini -n $tp(idle.txt) $1 $2 $ctime
- return $ctime
- }
- }
- alias idle {
- if (($1 == -r) && ($2)) {
- if ($isvalidchan(%idchan,$2)) {
- set %i 0
- :start
- inc %i
- if ($nick($2,%i) != $null) {
- writeini -n $tp(idle.txt) $2 $nick($2,%i) $ctime
- goto start
- }
- }
- else iecho Error: $hc($2) is not being watched.
- }
- elseif (($1 == -k) && ($2 ischan)) {
- if ($me !isop $2) iecho You are not opped on $hc($2) $+ .
- elseif ($isvalidchan(%idchan,$2)) {
- if ($3) set %idletmp $mpy($3,60)
- elseif (%idlemax) set %idletmp %idlemax
- else set %idletmp 1800
- set %i 0
- :start
- inc %i
- if ($nick($2,%i) == $null) { unset %idletmp | goto end }
- if ($nick($2,%i) isop $2) goto start
- if ($sub($ctime,$ch.idle($2,$nick($2,%i))) > %idletmp) .quote kick $2 $nick($2,%i) :idle $div(%idletmp,60) $+ m
- goto start
- :end
- }
- else iecho Error: $hc($2) is not being watched.
- }
- elseif ($1 == -s) {
- set %idchan $$?="Set channels to watch (type 'all' for all)"
- set %idlemax $mpy(60,$$?="Maximum idle time in minutes (current [ %idlemax ] )")
- set %idphrase $$?="Kick on anti-idle phrase (current [ %idphrase ] )"
- set %ikreason $$?="anti-idle kick reason (current [ %idreason ] )"
- }
- elseif (($1 == -v) && ($2 ischan)) {
- if ($isvalidchan(%idchan,$2)) {
- write -c $tp(idlep.txt)
- write $tp(idlep.txt) close:set $chr(37) $+ iloc $chr(36) $+ swlc(@IdleáStatistics) $chr(124) window -c @IdleáStatistics $chr(124) .remove $tp(idlep.txt)
- write $tp(idlep.txt) -
- set %i 0
- :start
- inc %i
- if ($chan(%i) == $null) {
- window -ae @IdleáStatistics %iloc /idle $tp(idlep.txt)
- aline @IdleáStatistics . $+ $str(-,47) $+ .
- aline @IdleáStatistics $chr(124) Idle Statistics for $fix(25,$hc($2)) $chr(124)
- aline @IdleáStatistics $chr(124) $+ $str(-,47) $+ $chr(124)
- set %i 1
- set %j $nick($2,0)
- :start1
- if (%j > 1) {
- aline @IdleáStatistics $chr(124) $fix(11,$clop($nick($2,%i),$2)) $lfix(9,$sc($rsc($duration($sub($ctime,$ch.idle($2,$nick($2,%i))))))) $chr(124) $fix(11,$clop($nick($2,$pls(1,%i)),$2)) $lfix(9,$sc($rsc($duration($sub($ctime,$ch.idle($2,$nick($2,$pls(1,%i)))))))) $chr(124)
- inc %i 2
- dec %j 2
- goto start1
- }
- if (%j == 1) aline @IdleáStatistics $chr(124) $fix(11,$clop($nick($2,%i),$2)) $lfix(9,$sc($rsc($duration($sub($ctime,$ch.idle($2,$nick($2,%i))))))) $chr(124) $str($chr(160),21) $chr(124)
- aline @IdleáStatistics ' $+ $str(-,23) $+ ' $+ $str(-,23) $+ '
- }
- elseif ($isvalidchan(%idchan,$chan(%i))) {
- write $tp(idlep.txt) $chan(%i)
- if ($me isop $chan(%i)) {
- write $tp(idlep.txt) .kick
- write $tp(idlep.txt) ..10m:idle -k $chan(%i) 10
- write $tp(idlep.txt) ..20m:idle -k $chan(%i) 20
- write $tp(idlep.txt) ..30m:idle -k $chan(%i) 30
- write $tp(idlep.txt) ..N m:idle -k $chan(%i) $chr(36) $+ ?="Enter number of minutes:"
- }
- write $tp(idlep.txt) .nick
- write $tp(idlep.txt) ..view
- write $tp(idlep.txt) ...silent:idle -n $chan(%i) $str($chr(36),2) $+ ?="Enter nickname"
- write $tp(idlep.txt) ...verbose:idle -c $chan(%i) $str($chr(36),2) $+ ?="Enter nickname"
- if ($me isop $chan(%i)) write $tp(idlep.txt) ..kick:.quote kick $chan(%i) $str($chr(36),2) $+ ?="Enter nickname" :idle $chr(36) $+ rsc( $+ $chr(36) $+ duration( $+ $chr(36) $+ sub( $+ $chr(36) $+ ctime, $+ $chr(36) $+ n.idle( $+ $chan(%i) $+ , $chr(36) $+ ! ))))
- write $tp(idlep.txt) .relist:idle -v $chan(%i)
- write $tp(idlep.txt) .-
- write $tp(idlep.txt) .reset:idle -r $chan(%i)
- goto start
- }
- else goto start
- }
- else iecho Error, $hc($2) is not being watched.
- }
- elseif (($1 == -n) && ($3)) {
- if ($nc($3) !ison $2) iecho $hc($3) is not on $hc($nc($2)) $+ .
- elseif ($isvalidchan(%idchan,$2)) iecho $hc($nc($3)) has been idle on $sc($2) for $hc($rsc($duration($sub($ctime,$ch.idle($2,$nc($3))))))
- else iecho Error: $hc($2) is not being watched.
- }
- elseif (($1 == -c) && ($3)) {
- if ($nc($3) !ison $2) iecho $hc($3) is not on $hc($nc($2)) $+ .
- if ($isvalidchan(%idchan,$2)) msg $2 $nc($3) has been idle on $2 for $rsc($duration($sub($ctime,$ch.idle($2,$nc($3)))))
- else iecho Error: $hc($2) is not being watched.
- }
- else iecho Syntax: /idle -<v|k|r|n|c|s> [#channel] [nickname/duration]
- }
-